<?php
session_start();
/**
* @package		ReservatieComponent voor ouderavonden van Atheneum Alicebourg Lanaken.
* @copyright	Copyright (C) 2008 Kristof Beckers. All rights reserved.
* @Version		1.0
* @license		GNU/GPL, see LICENSE.php
**/
include ("../../include/header.php");
?>

<head>
<link rel="stylesheet" href="../../css/template_css.css" type="text/css"/> 
</head>
<body onLoad="document.form.username.focus()">
<div align="center"><img src="<?php echo "../$logo" ; ?>" />
</div>
<p>
  <?php 

include ("../../include/config.php");
require_once ("../../include/db.php");
include ("../../include/header.php");

if(isset($_SESSION['myusername'])){
	if ($_SESSION['admin'] == "$adminid") {
?>
<?php
// Script om pauzes in te lassen.

$ressql="SELECT * FROM $tbres ";
$resresult=mysql_query($ressql);
$teller = 0 ;
echo "Selecteer het uur dat u voor \" $lln1 \" bij het CLB wil reserveren. <br>";

while ($rowres = mysql_fetch_array($resresult)) {
	$uur[$teller] = $rowres['Uur'];
	$teller ++ ;
}

$tijdsql="SELECT * FROM $tbparam WHERE datum='09-01-2009'";
$tijdresult=mysql_query($tijdsql);

while ($rowtijd = mysql_fetch_array($tijdresult)) {
	$start = $rowtijd['Beginuur'];
	$eind = $rowtijd['Einduur'];
	$sessie = $rowtijd['Sessieduur'];
	$klasdirectie = $rowtijd['Klasdirectie'];

$aantaluren= $eind-$start;
$aantgespr = $aantaluren*60/$sessie;
//$tijd=$sessie*60;

$event_time = "$start";
$time_block = "$aantgespr";
$event_length = $sessie; // minutes
$teller2 = 0 ;
for($i = 0, $eTime = strtotime($event_time);
$i < $time_block;
$i++, $eTime = strtotime("+$event_length minutes", $eTime))
{
$new_event_time = date('H:i', $eTime);


if ($new_event_time == $uur[$teller2]){

echo "$new_event_time (bezet) <br>" ; 
$teller2 ++ ;
}
else {
echo "$new_event_time <br>";
}

}
}}}



?>